UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rA0+Gc388XYoVMO8zEoqGeK1MkXp/ZwEc70XMmSHdL4='
WHERE
key_id = 'ffcae74bee57aa97a93cd13761bef212dfbde65235202efc978de82931c56eaf'
AND (
token = 'rA0+Gc388XYoVMO8zEoqGeK1MkXp/ZwEc70XMmSHdL4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)