UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'KLtxQlb+gMQ5Y0R0lR4Qg0RsJkBFy6t3E3q6EFcVTuo='
WHERE
key_id = 'e3b373bc84cd97aa64432cf814a4c585ca1b544b6d2b6d6f91549fd3e8c9b131'
AND (
token = 'KLtxQlb+gMQ5Y0R0lR4Qg0RsJkBFy6t3E3q6EFcVTuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)