UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4+UPrdkJLp1R3Gn0WcGEVlJsfY/XPDcyQfL8u5F78jg='
WHERE
key_id = '6ed2a29ce36edf571a1cdefd9ec1caa09265f9d0466b0072573a4d37c8eabf6e'
AND (
token = '4+UPrdkJLp1R3Gn0WcGEVlJsfY/XPDcyQfL8u5F78jg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)