UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5vZKRta0S89Bh+0eiZyTTzGrt5g775ivnIVARvBuyl4='
WHERE
key_id = '55519a2e43098e614eac0ed2512f37f103586292e2a4549a2d3f3ee7404e357c'
AND (
token = '5vZKRta0S89Bh+0eiZyTTzGrt5g775ivnIVARvBuyl4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)