UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '57dc6kwZ/dLItfYgHTNL4Ot3iEjx0q3Bei/uL6dL5m4=' 
WHERE 
  key_id = '76e69292edfd008583c91cb67cc299f4088f2347f606387e7aaf4b2171ca3303' 
  AND (
    token = '57dc6kwZ/dLItfYgHTNL4Ot3iEjx0q3Bei/uL6dL5m4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041