UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kt6SXPShG9QJ/jpCNkvVBH2fGlfS7hlsdsL+jGl7+t0=' 
WHERE 
  key_id = 'dbd433ab4fc20ffb362f2acc2bd58741b22090360e66bc2850b67ac0b7ad9945' 
  AND (
    token = 'kt6SXPShG9QJ/jpCNkvVBH2fGlfS7hlsdsL+jGl7+t0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016