UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '++5uAbpYsmzcletl2AIxENaakcn4HY0NZD2Diml7hEo=' 
WHERE 
  key_id = '6f181acc654fbe8f1e5efc3639e8537d8e183305b178577ae786d560b6c7e0a7' 
  AND (
    token = '++5uAbpYsmzcletl2AIxENaakcn4HY0NZD2Diml7hEo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049