UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gg4sYCW//VGQszJsY8i78b1bmKMBex1kSnG5lcPou9E='
WHERE
key_id = '8d0a25fe1f4815ac565b9550e6b248f1b238447f64b0eec782592e43afaac86a'
AND (
token = 'Gg4sYCW//VGQszJsY8i78b1bmKMBex1kSnG5lcPou9E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)