UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'JstG42goQ555QkWhcEG/73IZs7iJ96CpLmICwa+TVYg='
WHERE
key_id = '03c232f3c33c8a976bdf2c6c0745f1ff13e424c0597e7afe3fa344d618cd92d1'
AND (
token = 'JstG42goQ555QkWhcEG/73IZs7iJ96CpLmICwa+TVYg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)