UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EunD3+9CV6FXoZvoKDlcZg8EE/YbZg1G6nkEQnYZCnE='
WHERE
key_id = 'd7debc19bcaa55909c7c6c922f732cb58b5781c82f3d7b137fb6ce8471479110'
AND (
token = 'EunD3+9CV6FXoZvoKDlcZg8EE/YbZg1G6nkEQnYZCnE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)