UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mSpUyuffVh52sVzQt4LZhl1dslKfAf6uzeN43DqHI7M=' 
WHERE 
  key_id = 'eab64b4bccd5502c9c29aabda93978c42a02727703bf641f7392607e98401e15' 
  AND (
    token = 'mSpUyuffVh52sVzQt4LZhl1dslKfAf6uzeN43DqHI7M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024