UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Zg/ubRkuVKVyv03C37Uu5W2lDgocDllhOIA+XAv2N0='
WHERE
key_id = '0a255aad7695a97cc024b7aef470b82ee8554b01e27a9891b5b94639da0fba96'
AND (
token = '5Zg/ubRkuVKVyv03C37Uu5W2lDgocDllhOIA+XAv2N0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)