UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 's1iRgxQEC7xInGvawR2fHuzfAdsQ8zwNZyWNTBdAzxg='
WHERE
key_id = 'ef5a69d1f8888cbb018d797e5d0051d393595b7a6fc50a04de73b424c4b8d240'
AND (
token = 's1iRgxQEC7xInGvawR2fHuzfAdsQ8zwNZyWNTBdAzxg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)