UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '71KWsCM76S9Pknc7F+ImYl/Buw+L/1SCd2MDLW/N8LE=' 
WHERE 
  key_id = 'd2c28ec45b6e62726ff9f334ae2047d4e8ec7a759a67481808faff654644128c' 
  AND (
    token = '71KWsCM76S9Pknc7F+ImYl/Buw+L/1SCd2MDLW/N8LE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045