UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WxTAfqKeOMpraLNd9bOtXQo/NtY6DfAmPdNHHNBIKs8='
WHERE
key_id = 'c09ab2ba7bbc61cb247f3e1542fd283afc9ac09631ce85fc6cc8e62aab3cdc23'
AND (
token = 'WxTAfqKeOMpraLNd9bOtXQo/NtY6DfAmPdNHHNBIKs8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)