UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PRMADWAMHwigRSqdI1C5w2fxdLbw+dF1Hn+AabpVRAg='
WHERE
key_id = 'a45d00dd7f7af0f7bb7234c72086f71af666e8db9cb502cacf8788fa8e7e0d10'
AND (
token = 'PRMADWAMHwigRSqdI1C5w2fxdLbw+dF1Hn+AabpVRAg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)