UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uUQwbhKKexm0H3DQ4AbSHWBAKxKBXRW3J+iyn4EeghA=' 
WHERE 
  key_id = 'c0479d1de0ede0ef8d9d0ba957680ec4cda888ea2062db1d3c3541da4c33f0c2' 
  AND (
    token = 'uUQwbhKKexm0H3DQ4AbSHWBAKxKBXRW3J+iyn4EeghA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015