UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+h61VBShM3wCmh3ns5/s9J5gKf3glQI+NY2jfawAOMw='
WHERE
key_id = '6ec7ccc1f697c2249aaf86b2dc246277e047b8a249f205597a5ac336d055d75a'
AND (
token = '+h61VBShM3wCmh3ns5/s9J5gKf3glQI+NY2jfawAOMw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)