UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3bJAYLa6WRjd7DcupQqz6a2ASgBfrk97btZTNJSMDdE='
WHERE
key_id = 'bd78b9343cd0065c8258173eb938b26dd8157ae865ffd8a5729affb56c7be4fa'
AND (
token = '3bJAYLa6WRjd7DcupQqz6a2ASgBfrk97btZTNJSMDdE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)