UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CzeGsgVrb1AtSFSqcJ+MlhZrM+HOcAU3STw/OkdjJpE='
WHERE
key_id = '2a2faa0771b96f35473818e741a8c3ffb6fbbe4f8b3c9c5cd318ef06c4753711'
AND (
token = 'CzeGsgVrb1AtSFSqcJ+MlhZrM+HOcAU3STw/OkdjJpE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)