UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R8ztAS5AlgeaVPm/ojZHIt1qh/KMuRuFxNgn3PWVb6s='
WHERE
key_id = '2f09e7adab8f27342dd43097877b3af9d63f4187e92b45f930efc2a3cfaa2fd9'
AND (
token = 'R8ztAS5AlgeaVPm/ojZHIt1qh/KMuRuFxNgn3PWVb6s='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)