UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2PjN6KzrTO0SfLamzNXkia5XmHHbR6UgrUfhJZl+3xA='
WHERE
key_id = '4594ab57501e713c675dff48f10564ecfb067db37a508668efdf1d7a76368b51'
AND (
token = '2PjN6KzrTO0SfLamzNXkia5XmHHbR6UgrUfhJZl+3xA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)