UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'khtV/3DMGg41WmzZJDbUaMHRdNRP+z3RyVrje20kP+M='
WHERE
key_id = '6afbf0b5f4e3a63ecc19c44fb06134e0ab142cca3d3209f71627aba3310703d2'
AND (
token = 'khtV/3DMGg41WmzZJDbUaMHRdNRP+z3RyVrje20kP+M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)