UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'inAJYB/+QCawBW7McSxVV7PT86TQxMNQQHfEewYEluw=' 
WHERE 
  key_id = '32a9f7b80af47b9f3b814e82bd0d9d37969bd1eba8ad5dfd8513d2fce2ce28ad' 
  AND (
    token = 'inAJYB/+QCawBW7McSxVV7PT86TQxMNQQHfEewYEluw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016