UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5Qr9Qqnc4rtj9PCExyBKPXPN++OpoGVtEu/gykL02OA='
WHERE
key_id = 'dc3882a3c7284fb62773850c03d866431491734dadfaf375f978d2f8d53798ae'
AND (
token = '5Qr9Qqnc4rtj9PCExyBKPXPN++OpoGVtEu/gykL02OA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)