UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AAa3DeklFJ/kBbnHvdp9eLQXWZtpQF2hYccm7vKaxlQ='
WHERE
key_id = '44c5fcae09f24843427d4f636380198f52a8a3329269b335fe967fc84e5857d1'
AND (
token = 'AAa3DeklFJ/kBbnHvdp9eLQXWZtpQF2hYccm7vKaxlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)