UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VT/x6hWVfQIOh5O269c9lYYhbhjaS+uGA150cP+p0SA=' 
WHERE 
  key_id = '531f3da7cb6c75664e06db203ca4158d87e5d705d9b7d473f31346264cbfdf5b' 
  AND (
    token = 'VT/x6hWVfQIOh5O269c9lYYhbhjaS+uGA150cP+p0SA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032