UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+KtCur/buCT9APShsMJKWBRzRebjZ72ONquSs6cbtbg='
WHERE
key_id = 'b7218a5d26a56b5028ec6c418dfe468e70ef912851c4d7549400c6e49084f48c'
AND (
token = '+KtCur/buCT9APShsMJKWBRzRebjZ72ONquSs6cbtbg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)