UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K7/QjKDRrXK2L6tXOpFQwvjh/HiGC6guNree9UkDMPs='
WHERE
key_id = '30db5648718e4f64a30f86dbf5ab3c1b9354e32bca8bb6f42ddb6e68271ea53c'
AND (
token = 'K7/QjKDRrXK2L6tXOpFQwvjh/HiGC6guNree9UkDMPs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)