UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vvowlghEMuSvr7AaOzRy0OoubbXviVTBaolNcG1zZX0=' 
WHERE 
  key_id = 'd0b7792280d9ac62406187cdb9529fa19979ae001f5ac5107af3b5de10fa5c5d' 
  AND (
    token = 'vvowlghEMuSvr7AaOzRy0OoubbXviVTBaolNcG1zZX0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024