UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5NAjbjaWr4z3wlGfWu1CuN+FCe5en1KpPhBlFXjwazM='
WHERE
key_id = '1206c799a8d2615af8b0856d5a25c8340ccf8995e3c81d7b62018a294e943f07'
AND (
token = '5NAjbjaWr4z3wlGfWu1CuN+FCe5en1KpPhBlFXjwazM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)