UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MhlNO6ofwnkX5r5XMfQoT9dqeCWy+MPM28ObUjd4ZrE=' 
WHERE 
  key_id = '9e25d0047d72f5999a54b9167cc323c4bd6c1ed1b790b4cee057ed4e902feccb' 
  AND (
    token = 'MhlNO6ofwnkX5r5XMfQoT9dqeCWy+MPM28ObUjd4ZrE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00039