UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'pEofyFthKUKle0c0WuvTrqtm/ML9yk1xx/2PN5McH0o=' 
WHERE 
  key_id = '07eb5d4aa4752420ade228f8ac89144e683a1f0bfd831556adc18f87161e9b41' 
  AND (
    token = 'pEofyFthKUKle0c0WuvTrqtm/ML9yk1xx/2PN5McH0o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040