UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+iOGC1lD8vCL8s8dZWEtdR4W3s0/gjrtzkOkb9WvLf4='
WHERE
key_id = '2ac438486f09f6bd1de1123e68078960d697666d3b17a33dd795fa5c6d6924dd'
AND (
token = '+iOGC1lD8vCL8s8dZWEtdR4W3s0/gjrtzkOkb9WvLf4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)