UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0rxfuLoK5mZTdql8VL4d8bHVQ1XKYpOUd/rIJ3U+kMw='
WHERE
key_id = '3a8ba7262e4586232514d0b9aae518b19319f514b764fc478ebb1bc654089cba'
AND (
token = '0rxfuLoK5mZTdql8VL4d8bHVQ1XKYpOUd/rIJ3U+kMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)