UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VCPQqiJnzqkU49lRAbgWihwD0VffD+CvSI5Pykdv4SQ=' 
WHERE 
  key_id = '91b6575268653ddf5305bf4dc1d7acff0e5e71cd710fc1a220cbebe3ba234b02' 
  AND (
    token = 'VCPQqiJnzqkU49lRAbgWihwD0VffD+CvSI5Pykdv4SQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046