UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H5M7cOOHgiliOek+HvWEt4BaMel2FCTUq6L3Hkl4aLY=' 
WHERE 
  key_id = '055ab98878e24a2bbc6abf51a4f3ccb6820f61da5e781c4156913f43ae6a0b32' 
  AND (
    token = 'H5M7cOOHgiliOek+HvWEt4BaMel2FCTUq6L3Hkl4aLY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022