UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LXa58TWHH8r3idYo1v+zQpUP33lp+ZK38Xc7oVVToVE='
WHERE
key_id = '573d3165a4d785ce74d7d196e9b665ce45adefa2db93e8691065c50a4211d438'
AND (
token = 'LXa58TWHH8r3idYo1v+zQpUP33lp+ZK38Xc7oVVToVE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)