UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0McqXd/gsG0YgYtZupeFmV75iZbK6S40UQUg7RDAHSM='
WHERE
key_id = '04d18f153a5a2f651a3fa3b82329e17e2967ae6a95033afa24790a577e389e4b'
AND (
token = '0McqXd/gsG0YgYtZupeFmV75iZbK6S40UQUg7RDAHSM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)