UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4FxVI2+QBEwcJ2kVTFYBrfB5+8PMRq+MB69Tc6eZQLQ='
WHERE
key_id = '1a895dc1c372e612c3f9fc024c982d29bbb270017ebf56a7a530495d3c08aa51'
AND (
token = '4FxVI2+QBEwcJ2kVTFYBrfB5+8PMRq+MB69Tc6eZQLQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)