UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NHPKs0hl8f/EYzRH94hwvTUqwj883H7yAUONNAlWDe0='
WHERE
key_id = '8eeef9b6203b5003addb8e59a0278b09c6bdc5b31c35e2538f770702c8e0b47e'
AND (
token = 'NHPKs0hl8f/EYzRH94hwvTUqwj883H7yAUONNAlWDe0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)