UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'XYsV5TVG2MV2OKzu2pDnCzx+KemKRROxwN+icR2KRBY=' 
WHERE 
  key_id = 'c3cc3919edce51dc9b8d3b9b43f0b0fad0c9bc37aa21ee34bbcb25cf90d65ea9' 
  AND (
    token = 'XYsV5TVG2MV2OKzu2pDnCzx+KemKRROxwN+icR2KRBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044