UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'hZEpCY5xc4RL8cI2TmA/kygrWhaBYhU5dcPdf80soOI=' 
WHERE 
  key_id = '7a2acad0613932e806f2c5ccd94ba21fe7fa6faf2d5c87b4dcc27e3fb47054d2' 
  AND (
    token = 'hZEpCY5xc4RL8cI2TmA/kygrWhaBYhU5dcPdf80soOI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036