UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LQx+zPuQzco1NU12tFu20JQdQeOTd6uv9hDv+ARB8Ck=' 
WHERE 
  key_id = 'ff3dddd08785a0b7317d2db6aa918c443103217604be8111cb3b9145b23616f3' 
  AND (
    token = 'LQx+zPuQzco1NU12tFu20JQdQeOTd6uv9hDv+ARB8Ck=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017