UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OY1OsnoMY6M6djhYD6zg4/C1M37SgZrfWYOcQXbzdys='
WHERE
key_id = '0f3e6656be44037d4a3079d875f96804313609fb308bb34960760b81a044dbfa'
AND (
token = 'OY1OsnoMY6M6djhYD6zg4/C1M37SgZrfWYOcQXbzdys='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)