UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iZKJCOuEEth3ZZsB0xtrYnqe9BmxKC/2a4Wasu7YqlA='
WHERE
key_id = 'f7acc0228f211a2b66c7d470269152dc41056fc2fde7d44f1fd5047fb3923ca9'
AND (
token = 'iZKJCOuEEth3ZZsB0xtrYnqe9BmxKC/2a4Wasu7YqlA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)